02. Create tables for historical stock prices

PRDTM2-787 AI Trading C4 L3 Vid2 Create Tables For Historical Stock Prices

Setting Up a Database for Trading

Learn to define and create database tables for storing historical stock price data.

Core Steps:

  • Database Installation: Confirm installation on your trading computer.
  • Create Tables: Use SQL commands to set up necessary tables.

Essential Data Points:

  • Highest Bid Price: Maximum price to sell stocks.
  • Lowest Ask Price: Minimum price to buy stocks.
  • Timestamp: Tracks the exact time of events.
  • Use SQL’s timestamp data type for storing precise date-time.

Considerations:

  • Network Latency: Affects real-time buying/selling prices.
  • Average Prices: Useful for modeling even with latency.
  • Trading Costs: Bid/ask prices aid in understanding costs.

Table Definition:

  • Specify columns such as Time, Bid, and Ask.
  • For Time, use timestamp or text for flexibility.
  • For Bid and Ask, define as floating point numbers.

Remember, keep your database organized and ready for effective trading analysis.

What is the primary function of a database management system (DBMS)?

SOLUTION: To manage data, allowing for efficient storage, retrieval, and manipulation of information.

Which of the following statements will create a table named Orders with a Primary Key on the OrderID column?

SOLUTION: CREATE TABLE Orders (OrderID INT PRIMARY KEY);